package com.mk.admin.controller;

import com.mk.admin.log.WriteLog;
import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.DoctorLikesQuery;
import com.mk.admin.model.vo.DoctorLikesVo;
import com.mk.admin.service.DoctorLikesService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "医生被关注或收藏")
@RequestMapping("/a/adm/doctorLikes")
public class DoctorLikesController {
    @Autowired
    private DoctorLikesService doctorLikesService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody DoctorLikesQuery query) {
        return doctorLikesService.select(query);
    }

    @PostMapping("/add")
    @WriteLog("医生被关注或收藏增加")
    public ResultDto add(@RequestBody DoctorLikesVo vo) {
        return doctorLikesService.add(vo);
    }

    @PostMapping("/update")
    @WriteLog("医生被关注或收藏修改")
    public ResultDto update(@RequestBody DoctorLikesVo vo) {
        return doctorLikesService.update(vo);
    }

    @PostMapping("/delete")
    @WriteLog("医生被关注或收藏删除")
    public ResultDto delete(@RequestBody DoctorLikesVo vo) {
        return doctorLikesService.delete(vo.getId());
    }

    @PostMapping("/status")
    @WriteLog("医生被关注或收藏状态")
    public ResultDto status(@RequestBody DoctorLikesVo vo) {
        return doctorLikesService.status(vo.getId());
    }

}
